//
//  TextField+Extension.swift
//  HuaYun
//
//  Created by enghou on 2018/12/10.
//  Copyright © 2018 xyxorigation. All rights reserved.
//

import Foundation
@IBDesignable
extension UITextField {
    
    @IBInspectable var rightimaged: Bool {
        get{
            return self.rightView == nil ? false : true
        }
        set{
            let rightView = UIView()
            rightView.frame = CGRect.init(origin: CGPoint.zero, size: CGSize.init(width: 18, height: 18))
            let image = UIImage.init(named: "icon_down")
            let imageView = UIImageView.init(image: image)
            imageView.frame = CGRect.init(origin: CGPoint.zero, size: CGSize(width: 8, height: 5))
            imageView.center = rightView.center
            rightView.addSubview(imageView)
            self.rightView = rightView
            self.rightViewMode = .always
        }
    }
    
    
}
